#include <opencv2\opencv.hpp>
using namespace cv;
using namespace std;
int main() {
    Mat image = imread("image.jpg");     
    vector<Mat> channels;
    //    通道分离
    split(image, channels);
    //   分别得到不同的颜色通道
    Mat blue, green, red;
    blue = channels.at(0);
    green = channels.at(1);
    red = channels.at(2);
    //    通道合并
    Mat dstImage;
    vector<Mat> channels2;
    channels2.push_back(blue);
    channels2.push_back(green);
    channels2.push_back(red);
    merge(channels2, dstImage);
    imshow("图像展示 ", dstImage);
    waitKey(0);
    return 0;
}